package service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import dao.AppInfoDaoMapper;
import entity.App_info;
import entity.App_version;
import service.AppService;
import tools.Paging;

@Service("appinfo")
public class AppServiceImpl implements AppService {
	@Autowired
	private AppInfoDaoMapper appInfoDao;

	/**
	 * 查询审核列表
	 */
	@Override
	public List<App_info> queryAppInfo(String softwareName,
										Integer statusName,
										Integer categoryLevel1Name,
										Integer categoryLevel2Name, 
										Integer categoryLevel3Name,
										Paging paging) {
		
		
		
		return appInfoDao.queryAppInfo(softwareName, statusName, categoryLevel1Name, categoryLevel2Name, categoryLevel3Name,(paging.getCurrentPageNo()-1)*5,5);
	}
	
	/**
	 * 根据id查询
	 */
	@Override
	public App_info queryAppInfoById(Integer aid) {
		
		return appInfoDao.queryAppInfoById(aid);
	}

	/**
	 * app审核
	 */
	@Override
	public App_info updateAppCheck(Integer status, Integer aid) {
		
		return appInfoDao.updateAppCheck(status, aid);
	}

	/**
	 * 查询总记录数
	 */
	@Override
	public int dataTotal(String softwareName, Integer flatformId, Integer categoryLevel1,
			Integer categoryLevel2, Integer categoryLevel3) {
		
		return appInfoDao.dataTotal(softwareName, flatformId, categoryLevel1, categoryLevel2, categoryLevel3);
	}
}
